import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysCustomOrgInfo = (params) => {
  params.head.transCode = 'querySysCustomOrgInfo';
  return request({
    url: '/platform/sysCustomOrgInfo/querySysCustomOrgInfo',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysCustomOrgInfoListPage = (params) => {
  params.head.transCode = 'querySysCustomOrgInfoListPage';
  return request({
    url: '/platform/sysCustomOrgInfo/querySysCustomOrgInfoListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysCustomOrgInfo = (params) => {
  params.head.transCode = 'saveSysCustomOrgInfo';
  return request({
    url: '/platform/sysCustomOrgInfo/saveSysCustomOrgInfo',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysCustomOrgInfoList = (params) => {
  params.head.transCode = 'saveSysCustomOrgInfoList';
  return request({
    url: '/platform/sysCustomOrgInfo/saveSysCustomOrgInfoList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysCustomOrgInfo = (params) => {
  params.head.transCode = 'saveOrUpdateSysCustomOrgInfo';
  return request({
    url: '/platform/sysCustomOrgInfo/saveOrUpdateSysCustomOrgInfo',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysCustomOrgInfoList = (params) => {
  params.head.transCode = 'saveOrUpdateSysCustomOrgInfoList';
  return request({
    url: '/platform/sysCustomOrgInfo/saveOrUpdateSysCustomOrgInfoList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysCustomOrgInfo = (params) => {
  params.head.transCode = 'updateSysCustomOrgInfo';
  return request({
    url: '/platform/sysCustomOrgInfo/updateSysCustomOrgInfo',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysCustomOrgInfo = (params) => {
  params.head.transCode = 'deleteSysCustomOrgInfo';
  return request({
    url: '/platform/sysCustomOrgInfo/deleteSysCustomOrgInfo',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysCustomOrgInfoList = (params) => {
  params.head.transCode = 'deleteSysCustomOrgInfoList';
  return request({
    url: '/platform/sysCustomOrgInfo/deleteSysCustomOrgInfoList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysCustomOrgInfoExcel = (params) => {
  downloadExcel({
    url: '/platform/sysCustomOrgInfo/excelDownload/exportSysCustomOrgInfoExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
